Optimal. Leaf size=75 \[ -\frac {x}{b}+\frac {2 \sqrt {a^2-b^2} \tan ^{-1}\left (\frac {b+a \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2-b^2}}\right )}{a b d}-\frac {\tanh ^{-1}(\cos (c+d x))}{a d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.12, antiderivative size = 75, normalized size of antiderivative = 1.00, number of steps
used = 6, number of rules used = 6, integrand size = 25, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.240, Rules used = {2968, 3137,
2739, 632, 210, 3855} \begin {gather*} \frac {2 \sqrt {a^2-b^2} \text {ArcTan}\left (\frac {a \tan \left (\frac {1}{2} (c+d x)\right )+b}{\sqrt {a^2-b^2}}\right )}{a b d}-\frac {\tanh ^{-1}(\cos (c+d x))}{a d}-\frac {x}{b} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 210
Rule 632
Rule 2739
Rule 2968
Rule 3137
Rule 3855
Rubi steps
\begin {align*} \int \frac {\cos (c+d x) \cot (c+d x)}{a+b \sin (c+d x)} \, dx &=\int \frac {\csc (c+d x) \left (1-\sin ^2(c+d x)\right )}{a+b \sin (c+d x)} \, dx\\ &=-\frac {x}{b}+\frac {\int \csc (c+d x) \, dx}{a}-\left (-\frac {a}{b}+\frac {b}{a}\right ) \int \frac {1}{a+b \sin (c+d x)} \, dx\\ &=-\frac {x}{b}-\frac {\tanh ^{-1}(\cos (c+d x))}{a d}+\frac {\left (2 \left (\frac {a}{b}-\frac {b}{a}\right )\right ) \text {Subst}\left (\int \frac {1}{a+2 b x+a x^2} \, dx,x,\tan \left (\frac {1}{2} (c+d x)\right )\right )}{d}\\ &=-\frac {x}{b}-\frac {\tanh ^{-1}(\cos (c+d x))}{a d}-\frac {\left (4 \left (\frac {a}{b}-\frac {b}{a}\right )\right ) \text {Subst}\left (\int \frac {1}{-4 \left (a^2-b^2\right )-x^2} \, dx,x,2 b+2 a \tan \left (\frac {1}{2} (c+d x)\right )\right )}{d}\\ &=-\frac {x}{b}+\frac {2 \sqrt {a^2-b^2} \tan ^{-1}\left (\frac {b+a \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2-b^2}}\right )}{a b d}-\frac {\tanh ^{-1}(\cos (c+d x))}{a d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.09, size = 90, normalized size = 1.20 \begin {gather*} -\frac {a c+a d x-2 \sqrt {a^2-b^2} \tan ^{-1}\left (\frac {b+a \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2-b^2}}\right )+b \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )-b \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )}{a b d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.16, size = 94, normalized size = 1.25
method | result | size |
derivativedivides | \(\frac {\frac {\left (2 a^{2}-2 b^{2}\right ) \arctan \left (\frac {2 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+2 b}{2 \sqrt {a^{2}-b^{2}}}\right )}{a b \sqrt {a^{2}-b^{2}}}+\frac {\ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a}-\frac {2 \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{b}}{d}\) | \(94\) |
default | \(\frac {\frac {\left (2 a^{2}-2 b^{2}\right ) \arctan \left (\frac {2 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+2 b}{2 \sqrt {a^{2}-b^{2}}}\right )}{a b \sqrt {a^{2}-b^{2}}}+\frac {\ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a}-\frac {2 \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{b}}{d}\) | \(94\) |
risch | \(-\frac {x}{b}+\frac {i \sqrt {a^{2}-b^{2}}\, \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i \left (a +\sqrt {a^{2}-b^{2}}\right )}{b}\right )}{d b a}-\frac {i \sqrt {a^{2}-b^{2}}\, \ln \left ({\mathrm e}^{i \left (d x +c \right )}-\frac {i \left (-a +\sqrt {a^{2}-b^{2}}\right )}{b}\right )}{d b a}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{d a}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{d a}\) | \(155\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: ValueError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.40, size = 262, normalized size = 3.49 \begin {gather*} \left [-\frac {2 \, a d x + b \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) - b \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) - \sqrt {-a^{2} + b^{2}} \log \left (-\frac {{\left (2 \, a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} - 2 \, a b \sin \left (d x + c\right ) - a^{2} - b^{2} - 2 \, {\left (a \cos \left (d x + c\right ) \sin \left (d x + c\right ) + b \cos \left (d x + c\right )\right )} \sqrt {-a^{2} + b^{2}}}{b^{2} \cos \left (d x + c\right )^{2} - 2 \, a b \sin \left (d x + c\right ) - a^{2} - b^{2}}\right )}{2 \, a b d}, -\frac {2 \, a d x + b \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) - b \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) + 2 \, \sqrt {a^{2} - b^{2}} \arctan \left (-\frac {a \sin \left (d x + c\right ) + b}{\sqrt {a^{2} - b^{2}} \cos \left (d x + c\right )}\right )}{2 \, a b d}\right ] \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\cos {\left (c + d x \right )} \cot {\left (c + d x \right )}}{a + b \sin {\left (c + d x \right )}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 5.24, size = 94, normalized size = 1.25 \begin {gather*} -\frac {\frac {d x + c}{b} - \frac {\log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right )}{a} - \frac {2 \, {\left (\pi \left \lfloor \frac {d x + c}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (a\right ) + \arctan \left (\frac {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + b}{\sqrt {a^{2} - b^{2}}}\right )\right )} \sqrt {a^{2} - b^{2}}}{a b}}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 5.39, size = 896, normalized size = 11.95 \begin {gather*} \frac {\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{a\,d}+\frac {2\,\mathrm {atan}\left (\frac {64\,a^3}{64\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^3+64\,a^2\,b-64\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a\,b^2-64\,b^3}-\frac {64\,a\,b^2}{64\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^3+64\,a^2\,b-64\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a\,b^2-64\,b^3}+\frac {64\,b^3\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{64\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^3+64\,a^2\,b-64\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a\,b^2-64\,b^3}-\frac {64\,a^2\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{64\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^3+64\,a^2\,b-64\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a\,b^2-64\,b^3}\right )}{b\,d}-\frac {2\,\mathrm {atanh}\left (\frac {64\,a^2\,\sqrt {b^2-a^2}}{256\,a^2\,b-768\,b^3+\frac {512\,b^5}{a^2}-64\,a^3\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+832\,a\,b^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )-\frac {1792\,b^4\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{a}+\frac {1024\,b^6\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{a^3}}-\frac {512\,b^2\,\sqrt {b^2-a^2}}{256\,a^2\,b-768\,b^3+\frac {512\,b^5}{a^2}-64\,a^3\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+832\,a\,b^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )-\frac {1792\,b^4\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{a}+\frac {1024\,b^6\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{a^3}}+\frac {512\,b^4\,\sqrt {b^2-a^2}}{256\,a^4\,b+512\,b^5-768\,a^2\,b^3-64\,a^5\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )-1792\,a\,b^4\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+832\,a^3\,b^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+\frac {1024\,b^6\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{a}}-\frac {1280\,b^3\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {b^2-a^2}}{256\,a^3\,b-768\,a\,b^3+\frac {512\,b^5}{a}-64\,a^4\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )-1792\,b^4\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+832\,a^2\,b^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+\frac {1024\,b^6\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{a^2}}+\frac {1024\,b^5\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {b^2-a^2}}{-64\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^6+256\,a^5\,b+832\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^4\,b^2-768\,a^3\,b^3-1792\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^2\,b^4+512\,a\,b^5+1024\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,b^6}+\frac {320\,a\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {b^2-a^2}}{256\,a^2\,b-768\,b^3+\frac {512\,b^5}{a^2}-64\,a^3\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+832\,a\,b^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )-\frac {1792\,b^4\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{a}+\frac {1024\,b^6\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{a^3}}\right )\,\sqrt {b^2-a^2}}{a\,b\,d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________